#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main()
{
    int num;
    while (scanf(" %d", &num) != EOF) {
        int *list;
        list = (int*)malloc(num * sizeof(int));

        for (int i = 0; i < num; i++) {
            scanf(" %d", &list[i]);
        }
        sort(list, list + num);

        int sum = list[0], last = list[0];
        for (int i = 1; i < num; i++) {
            sum += list[i];
            if (list[i] == last) {
                sum -= list[i] * 2;
                last = 0;
            } else
                last = list[i];
        }
        printf("%d\n", sum);
        free(list);
    }

    return 0;
}
